import request from "../request"

export class PostMemberService {
    async Join({id, nickName,remark, invitationCode}) {
        let p = {
            nickName: nickName,
            remark: remark
        }
        if(invitationCode) {
            p.invitationCode = invitationCode
        }
        let json = await request({
            url: `/api/PostRecruitMember/${id}/member`,
            type: 'POST',
            params: p
        })
        return json.result
    }
    async Quit({id}) {
        let json = await request({
            url: `/api/PostRecruitMember/${id}/member`,
            type: 'DELETE',
            params: {
            }
        })
        return json.result
    }
    async Add({id, memberUserId}) {
        let json = await request({
            url: `/api/PostRecruitMember/${id}/member/${memberUserId}`,
            type: 'POST',
            params: {}
        })
        return json.result
    }
    async Remove({id, memberUserId}) {
        let json = await request({
            url: `/api/PostRecruitMember/${id}/member/${memberUserId}`,
            type: 'DELETE',
            params: {}
        })
        return json.result
    }
}
